package cate.game.play.vo;

import cate.game.play.proce.play.PlayPO;
import cate.game.play.proce.play.PlayStory;
import com.fasterxml.jackson.annotation.JsonProperty;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "战报",detail = "省略了战斗过程")
public class PlayReportVO {

	@NoteField("剧本唯一id")
	public String uid;

	@NoteField("最大回合数")
	public int roundMax;

	@NoteField("实际的回合数")
	public int round;

	@NoteField("队伍的开局状态记录")
	public TeamVSVO teamBegin;

	@NoteField("A方信息")
	@JsonProperty("side1")
	public PlaySideVO a;

	@NoteField("B方信息")
	@JsonProperty("side2")
	public PlaySideVO b;

	@NoteField("统计数据")
	public FightStatVO stat;

	@NoteField("剧本故事")
	public PlayStory story;

	@NoteField("胜利方")
	public byte winner;


	public PlayReportVO() {
	}

	public PlayReportVO(PlayPO play) {
		this.uid = play.uid;
		this.roundMax = play.roundMax;
		this.round = play.rounds.size();
		this.teamBegin = new TeamVSVO().read(play.teamBegin);
		this.a = new PlaySideVO().read(play.a);
		this.b = new PlaySideVO().read(play.b);
		this.stat = new FightStatVO().read(play.teamEnd);
		this.story = play.story;
		this.winner = play.winner;
	}
}
